﻿using System;
using System.Collections.Generic;
using yiCommerce.Core.Domain.Addresses;
using yiCommerce.Core.Domain.FriendShips;
using yiCommerce.Core.Domain.Orders;
using yiCommerce.Core.Domain.ShoppingCarts;
using yiCommerce.Core.Domain.Shops;

namespace yiCommerce.Core.Domain.Customers
{
    public class Customer:BaseEntity
    {
        public virtual string Username { get; set; }
        public virtual Guid UserGuid { get; set; }
        public virtual string Email { get; set; }
        public virtual string Password { get; set; }
        public virtual string NickName { get; set; }
        public virtual string Intro{ get; set; }
        public virtual string SelectedPaymentMethodSystemName { get; set; }
        public virtual Address ShippingAddress { get; set; }

        public virtual int? ShopId { get; set; }
        public virtual Shop Shop { get; set; }


        public virtual CustomerLogo CustomerLogo { get; set; }
        public virtual int? CustomerLogoId { get; set; }

        public virtual bool Deleted { get; set; }

        public virtual bool Active { get; set; }

        public virtual DateTime CreatedOn { get; set; }

        public virtual FriendShipGroup FriendShipGroup { get; set; }

        private ICollection<Order> _orders;
        private ICollection<CustomerRole> _customerRoles;

        private ICollection<ShoppingCartItem> _shoppingCartItems;

        private ICollection<Address> _addresses;

        public virtual ICollection<CustomerRole> CustomerRoles
        {
            get { return _customerRoles ?? (_customerRoles = new List<CustomerRole>()); }
            set { _customerRoles = value; }
        }

        public virtual ICollection<ShoppingCartItem> ShoppingCartItems
        {
            get { return _shoppingCartItems ?? (_shoppingCartItems = new List<ShoppingCartItem>()); }
            set { _shoppingCartItems = value; }
        }


        public virtual ICollection<Address> Addresses
        {
            get { return _addresses ?? (_addresses = new List<Address>()); }
            set { _addresses = value; }
        }

        public virtual ICollection<Order> Orders
        {
            get { return _orders ?? (_orders = new List<Order>()); }
            set { _orders = value; }
        }


        public virtual ICollection<FriendShipGroup> FriendShipGroups { get; set; }

        public virtual int? FriendShipGroupId { get; set; }
    }
}